#include "background.h"
#include "load/elementload.h"

QImage Background::icon() const
{
    return m_icon;
}

void Background::setIcon(const QImage &icon)
{
    m_icon = icon;
}

int Background::index() const
{
    return m_index;
}

void Background::setIndex(int index)
{
    m_index = index;
}

Background::Background()
    : SuperElement()
{
}

Background::Background(int x, int y, int w, int h, QImage icon, int index)
    : SuperElement(x, y, w, h)
    , m_icon(icon)
    , m_index(index)
{
}

QSharedPointer<Background> Background::createBackground(int index)
{
    QImage icon = ElementLoad::instance().imageMap().value("bg" + QString::number(index));
    return  QSharedPointer<Background>(new Background(0, 0, 480,480, icon, index));
}

void Background::showElement()
{

}

void Background::move()
{

}

void Background::destroy()
{

}

void Background::allowPass()
{

}

QRectF Background::boundingRect() const
{

}

void Background::paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget)
{

}

